/*
 * @Author: taoyuqing
 * @Date: 2023-01-02 18:41:01
 * @Description: 
 */
import 'package:flutter/material.dart';

class CopyInput extends StatefulWidget {
  final double? width;
  final String? copyContent;
  final Color? copyContentColor;
  final bool? showBorder;
  CopyInput(
      {Key? key,
      this.width,
      this.copyContent,
      this.copyContentColor,
      this.showBorder = true})
      : super(key: key);

  @override
  State<CopyInput> createState() => _CopyInputState();
}

class _CopyInputState extends State<CopyInput> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: widget.width,
      padding: EdgeInsets.only(left: 20, right: 20),
      decoration: BoxDecoration(
          color: widget.copyContentColor,
          borderRadius: BorderRadius.all(Radius.circular(10.0)),
          border: widget.showBorder != true
              ? null
              : Border.all(
                  width: 1, color: Color.fromRGBO(255, 255, 255, 0.5))),
      child: Row(
        children: [
          Expanded(
              child: TextField(
            // enabled: false,
            style: TextStyle(color: Colors.white),
            controller: TextEditingController(text: widget.copyContent ?? ''),
            decoration: InputDecoration(
              border: InputBorder.none,
            ),
          )),
          Container(
            margin: EdgeInsets.only(left: 8),
            child: Icon(
              Icons.link,
              color: Colors.white,
            ),
          )
        ],
      ),
    );
  }
}
